package cn.dzhang.rcp.hyperbola.editors;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

@SuppressWarnings("rawtypes")
public class ChatEditorInput implements IEditorInput {

	private String participat;

	public ChatEditorInput(String participat) {
		super();
		this.participat = participat;
	}

	@Override
	public Object getAdapter(Class adapter) {
		return null;
	}

	@Override
	public boolean exists() {
		return false;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		return null;
	}

	@Override
	public String getName() {
		return participat;
	}

	@Override
	public IPersistableElement getPersistable() {
		return null;
	}

	@Override
	public String getToolTipText() {
		return participat;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((participat == null) ? 0 : participat.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ChatEditorInput other = (ChatEditorInput) obj;
		if (participat == null) {
			if (other.participat != null)
				return false;
		} else if (!participat.equals(other.participat))
			return false;
		return true;
	}

}
